package com.jmh.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jmh.dao.StudentDao;
import com.jmh.entity.Student;
import com.jmh.service.StudentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class StudentServiceImpl implements StudentService {

    @Resource
    private StudentDao studentDao;

    @Override
    public void testDao() {
        /*Student student = studentDao.selectById(24);
        System.out.println(student);*/
        QueryWrapper<Student> wrapper = new QueryWrapper();
        wrapper.in("id",24,26,27,29)
        .like("name","小")
        .or()
        .gt("chinese","60");
        List<Student> studentList = studentDao.selectList(wrapper);
        System.out.println(studentList);
    }
}
